package entity.hard;

import java.util.Date;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.NotNull;
import com.springboot.frame.excel.annotation.Excel;
import com.springboot.frame.excel.annotation.ExcelAttribute;
import com.springboot.frame.excel.annotation.HeaderStyle;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.VerticalAlignment;

/**
 * Created by kanyuxia on 2017/7/26.
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Excel
public class Student {

  @HeaderStyle(fontName = "黑体", fontColor = IndexedColors.CORAL)
  @ExcelAttribute(value = "ID", fontColor = IndexedColors.RED, fontBold = true, width = 55)
  private Integer id;

  @ExcelAttribute(value = "学生姓名", fontName = "华文彩云", fontStrikeout = true)
  @NotNull(message = "学生姓名不能为null")
  private String name;

  @ExcelAttribute(value = "性别", needMerge = true)
  @NotNull(message = "学生性别不能为null")
  private String sex;

  @ExcelAttribute(value = "出生日期", width = 30, needMerge = true)
  @HeaderStyle(fillColor = IndexedColors.GREY_25_PERCENT)
  private Date birthday;

  @ExcelAttribute(value = "成绩", fontName = "Arial", fontBold = true, fontSize = 22, horizontal = HorizontalAlignment.LEFT, vertical = VerticalAlignment.TOP, width = 20)
  @DecimalMax(value = "100.00", message = "成绩最高为100")
  @HeaderStyle(fillColor = IndexedColors.AQUA, fontSize = 15)
  private Double grade;

}
